//
//  SettingsController.m
//  Pianke
//
//  Created by BetaTheta on 16/1/17.
//  Copyright © 2016年 BetaTheta. All rights reserved.
//

#import "SettingsController.h"

@interface SettingsController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, retain) NSIndexPath *indexPath;
@end

@implementation SettingsController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStyleGrouped];
    tableView.delegate = self;
    tableView.dataSource = self;
    [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    [self.view addSubview:tableView];
    [tableView release];
}
// 分区数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 3;
}

//
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0) {
        return 3;
    }else if (section == 1) {
        return 4;
    } else {
        return 1;
    }
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"forIndexPath:indexPath];
    if (indexPath.section == 0) {
        NSArray *arr = @[@"通用设置", @"推荐片刻", @"给个好评"];
        cell.textLabel.text  = arr[indexPath.row];
        return cell;
    }else if (indexPath.section == 1) {
        NSArray *arr = @[@"关于片刻", @"意见反馈", @"常见问题", @"使用指南"];
        cell.textLabel.text = arr[indexPath.row];
        return cell;
    } else {
        cell.textLabel.text = @"登陆账号";
        return cell;
    }
    
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
